<?php
/**
 * ImportTable.php
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */

/** base class */
require_once 'Zend/Db/Table/Abstract.php';

require_once 'Zend/Date.php';

/**
 * ImportTable
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */
abstract class ImportTable extends Zend_Db_Table_Abstract 
{
    /**
     * Madoqua target table
     *
     * @var Zend_Db_Table_Abstract
     */
    protected $_targetTable = null;
    
    abstract public function import();
    
    public function __construct($config = array())
    {
        $prefixKey  = 'prefix';
        $adapterKey = 'adapter';
        
        if (isset($config[$prefixKey])) {
            $this->_name = $config[$prefixKey] . $this->_name;
        }
        
        if (isset($config[$adapterKey])) {
            if ($config[$adapterKey] instanceof Zend_Db_Adapter_Abstract) {
                $this->_db = $config[$adapterKey];
            }
        }
        
        parent::__construct($config);
    }
}